<div class="bg-light lter b-b wrapper-md">
  <h1 class="m-n font-thin h3">公益游产品配置</h1>
</div>
<div class="panel panel-default">
  <div class="panel-body">
    <div class="col-lg-3">
      <div class="input-group">
        <div class="input-group-btn">
          <span class="btn btn-default">机构名称</span>
        </div>
        <input type="text" class="form-control" ng-model="fromData.company_name">
      </div>
    </div>
    <div class="col-lg-4">
      <div class="input-group">
        <div class="input-group-btn">
          <span class="btn btn-default">选择活动</span>
        </div>
        <ui-select ng-model="fromData.activity_id" theme="bootstrap">
          <ui-select-match placeholder="选择活动..">{{$select.selected.title}}</ui-select-match>
          <ui-select-choices repeat="activity.id as activity in activities | filter: $select.search">
            <span ng-bind-html="activity.title | highlight: $select.search"></span>
          </ui-select-choices>
        </ui-select>
      </div>
    </div>
    <div class="col-lg-2">
      <button class="btn btn-success" ng-click="search(1)">立即搜索</button>
    </div>
    <div class="col-lg-2 pull-right">
      <button class="btn btn-primary btn-block" ng-click="add(info)">添 加</button>
    </div>
  </div>

  <div class="panel-body">

    <!-- 网络太差, 画圈等 -->
    <h3 class="col-sm-12 text-center" ng-show="fromData.loading">
      <i class="fa fa-spin fa-spinner hide show inline"/>
    </h3>

    <table class="table table-striped table-bordered" ng-show="!fromData.loading">
      <thead>
        <tr>
        <th style="width: 20%; text-align: center">机构名称</th>
        <th style="width: 20%; text-align: center">活动名称</th>
        <th style="width: 15%; text-align: center">出游日期</th>
        <th style="width: 13%; text-align: center">名额(人)</th>
        <th style="width: 12%; text-align: center"></th>
        </tr>
      </thead>
      <tbody>
        <tr ng-repeat="info in list" style="height: 51px">
          <td style="vertical-align: middle;">{{info.company_name}}（{{info.company_code}}）</td>
          <td style="vertical-align: middle">{{info.title}}</td>
          <td class="text-center" style="vertical-align: middle">{{info.tour_date}}</td>
          <td class="text-center" style="vertical-align: middle">
            <span ng-show="!info.update">{{info.tour_stock}}</span>
            <input type="number" ng-show="info.update" class="form-control" ng-model="info.tour_stock">
          </td>
          <td class="text-center" style="vertical-align: middle">
            <div ng-if="info.expire == 1">
              <button type="button" class="btn btn-info btn-xs" ng-show="!info.update" ng-click="update(info)">编辑</button>
              <button type="button" class="btn btn-success btn-xs" ng-show="info.update" ng-click="save(info)">保存</button>
              <button type="button" class="btn btn-danger btn-xs" ng-click="delete(info)">删除</button>
            </div>
          </td>
        </tr>
      </tbody>
    </table>
    <div class="text-right" ng-show="!fromData.loading" style="background-color: white; margin-right: 30px">
      <pagination total-items="totalItems" ng-model="currentPage" ng-change="search(currentPage)" 
       previous-text="上一页" next-text="下一页" first-text="首页" last-text="尾页" max-size="5" 
       boundary-links="true" rotate="false" items-per-page="itemsPerPage" class="m-t-none m-b"></pagination>
    </div>
  </div>

</div>
      